package com.spzx.product.api.factory;

import com.spzx.common.core.domain.R;
import com.spzx.product.api.RemoteSkuStockService;
import com.spzx.product.api.vo.SkuLockVo;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

/**
 * @author LOGIN
 * @title RemoteSkuStockServiceFallbackFactory
 * @create 2025/7/31 16:19
 * @description
 */
public class RemoteSkuStockServiceFallbackFactory implements FallbackFactory<RemoteSkuStockService> {
    @Override
    public RemoteSkuStockService create(Throwable cause) {
        return new RemoteSkuStockService(){
            @Override
            public R<String> checkAndLock(String orderNo, List<SkuLockVo> skuLockVoList, String source) {
                return R.fail("检查与锁定库存失败" + cause.getMessage());
            }
        };

    }
}
